﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
@Html.Partial("LoadPanelPartial")
<html>
<head>
     @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

    )
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script type="text/javascript">

        $(function () {
            ASPxClientComboBox.Cast("DeptNo").SetValue($('#hddeptNo').val());
            
        });
    

        function search() {
            var deptNo = DeptNo.GetValue();
            if (deptNo == null) {
                deptNo = "";
            }
            window.location.href = rootPath + "/Admin/OfficeItemDeptCount/OfficeItemDeptCountList?deptNo="
            + deptNo + "&startDate=" + StartDate.GetText() + "&endDate=" + EndDate.GetText();
           
        }

        function ExportToExcel_Click() {
            var deptNo = DeptNo.GetValue();
            if (deptNo == null) {
                deptNo = "";
            }
            window.location.href = rootPath + "/Admin/OfficeItemDeptCount/OfficeItemDeptCountExportToExcel?deptNo="
            + deptNo + "&startDate=" + StartDate.GetText() + "&endDate=" + EndDate.GetText();

        }

        function popDialog(deptNo) {
            window.showModalDialog(rootPath + "/Admin/OfficeItemDeptCount/OfficeItemDeptCountInfo?deptNo=" + deptNo, 'popDialog', 'dialogWidth:600px;dialogHeight:660px');
            
        }

    </script>

</head>

<body>
    <div align="right">
        <table>
            <tr>
                <td>
                    部门:
                </td>
                <td>
                     @Html.DevExpress().ComboBox(settings =>
                    {
                        settings.Name = "DeptNo";
                        settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                        settings.Enabled = true;
                        settings.Properties.TextField = "Text";
                        settings.Properties.ValueField = "Value";
                }).BindList(ViewData["deptList"]).Bind(ViewData["deptNo"]).GetHtml()
                </td>
                <td>
                    日期:
                </td>
                <td>
                    @Html.DevExpress().DateEdit(settings => {
                       settings.Name = "StartDate";
                       settings.Properties.NullText = "";
                       settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                       settings.Properties.EditFormatString = "yyyy-MM-dd";                                     
                    }).GetHtml()
                </td>
                <td>——</td>
                <td>
                    @Html.DevExpress().DateEdit(settings => {
                       settings.Name = "EndDate";
                       settings.Properties.NullText = "";
                       settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                       settings.Properties.EditFormatString = "yyyy-MM-dd";                                     
                    }).GetHtml()
                </td>
                
                <td>
                    @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnSearch";
                   settings.Text = "查询";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                   settings.ClientSideEvents.Click = "function(){search()}";
               }).GetHtml()
                </td>
                <td>
                @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnDE";
                   settings.Text = "导出Excel";
                   settings.ControlStyle.CssClass = "button";
                   //settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                   settings.ClientSideEvents.Click = "function(){ExportToExcel_Click()}";
               }).GetHtml()
                </td>


            </tr>
        </table>                     
    </div>
    <table width='100%'>
        <tr>
            <td>&nbsp;</td>
            <td>           
                @Html.Raw(ViewData["strHtml"].ToString())
            </td>        
        </tr>   
    </table>
    


    @Html.Hidden("hddeptNo", ViewData["deptNo"])
    @Html.Hidden("hdstartDate", ViewData["startDate"])
    @Html.Hidden("hdendDate", ViewData["endDate"])
     <script type="text/javascript">
         lp.Hide();
    </script>
</body>
</html>
